\hypertarget{classsock_1_1net_1_1_tcp_connection}{}\section{sock\+:\+:net\+:\+:Tcp\+Connection Class Reference}
\label{classsock_1_1net_1_1_tcp_connection}\index{sock\+::net\+::\+Tcp\+Connection@{sock\+::net\+::\+Tcp\+Connection}}


网络连接  




{\ttfamily \#include $<$tcp\+\_\+connection.\+h$>$}

Inheritance diagram for sock\+:\+:net\+:\+:Tcp\+Connection\+:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=3.000000cm]{classsock_1_1net_1_1_tcp_connection}
\end{center}
\end{figure}
\subsection*{Public Types}
\begin{DoxyCompactItemize}
\item 
enum \hyperlink{classsock_1_1net_1_1_tcp_connection_ac6a1f1dc74ce847b7aab5f9c1c8d6574}{State} \{ \hyperlink{classsock_1_1net_1_1_tcp_connection_ac6a1f1dc74ce847b7aab5f9c1c8d6574a92fcb3956c72ee14fb17b6d187517d9a}{C\+O\+N\+N\+E\+C\+T}, 
\hyperlink{classsock_1_1net_1_1_tcp_connection_ac6a1f1dc74ce847b7aab5f9c1c8d6574a7deeba93cda3dfa27db748cafe5ca9aa}{C\+L\+O\+S\+I\+N\+G}, 
\hyperlink{classsock_1_1net_1_1_tcp_connection_ac6a1f1dc74ce847b7aab5f9c1c8d6574a456b48c073c8b92394f8e74a39646ec4}{C\+L\+O\+S\+E\+D}
 \}
\item 
typedef boost\+::function$<$ void(\hyperlink{classsock_1_1net_1_1_tcp_connection}{Tcp\+Connection} \&)$>$ \hyperlink{classsock_1_1net_1_1_tcp_connection_a9d9ea93c3a51141616167ae78c0238ec}{Pass\+Tcp\+Connection\+Ref\+Func}
\item 
typedef boost\+::function$<$ void(\hyperlink{classsock_1_1net_1_1_tcp_connection}{Tcp\+Connection} \&, \hyperlink{classsock_1_1net_1_1_tcp_connection_input_stream}{Tcp\+Connection\+Input\+Stream} \&)$>$ \hyperlink{classsock_1_1net_1_1_tcp_connection_a836ed49de731537f208e17d07868a9d8}{Tcp\+Connection\+Read\+Func}
\item 
typedef boost\+::function$<$ void(\hyperlink{classsock_1_1net_1_1_tcp_connection}{Tcp\+Connection} \&, \hyperlink{classsock_1_1net_1_1_tcp_connection_output_stream}{Tcp\+Connection\+Output\+Stream} \&)$>$ \hyperlink{classsock_1_1net_1_1_tcp_connection_ab8951d995ac681b06a8d8dfdadd219aa}{Tcp\+Connection\+Write\+Func}
\end{DoxyCompactItemize}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{classsock_1_1net_1_1_tcp_connection_a43ee94855cd5bc5b46e5bb5b3fbb545c}{Tcp\+Connection} (sock\+\_\+t sock, size\+\_\+t is\+Size=1024 $\ast$32, size\+\_\+t os\+Size=1024 $\ast$32)
\begin{DoxyCompactList}\small\item\em Tcp连接构造函数 \end{DoxyCompactList}\item 
\hyperlink{classsock_1_1net_1_1_tcp_connection_aa40d248ffbd3fd3aaf82dcf754c1e204}{Tcp\+Connection} (sock\+\_\+t sock, \hyperlink{namespacesock_1_1net_a2165d5b91136adc8c72ad25bfdbd0968}{Byte\+Buffer} ibuff, \hyperlink{namespacesock_1_1net_a2165d5b91136adc8c72ad25bfdbd0968}{Byte\+Buffer} obuff, size\+\_\+t is\+Size, size\+\_\+t os\+Size)
\begin{DoxyCompactList}\small\item\em Tcp连接构造函数 \end{DoxyCompactList}\item 
virtual \hyperlink{classsock_1_1net_1_1_tcp_connection_a726cd8559fa3a133b47a15f10ebbe6dc}{$\sim$\+Tcp\+Connection} (void)
\item 
void \hyperlink{classsock_1_1net_1_1_tcp_connection_a61f65d30aed34c170e355ce5841dc1d3}{shutdown} (void)
\begin{DoxyCompactList}\small\item\em 关闭连接 \end{DoxyCompactList}\item 
int \hyperlink{classsock_1_1net_1_1_tcp_connection_a180476e4513ce0ccdc23316ce791faf2}{get\+Id} (void) const 
\begin{DoxyCompactList}\small\item\em 获取\+I\+D \end{DoxyCompactList}\item 
\hyperlink{classsock_1_1net_1_1_socket}{Socket} $\ast$ \hyperlink{classsock_1_1net_1_1_tcp_connection_a895047bafd0cbed7850da3fd355c679c}{get\+Sock} (void)
\begin{DoxyCompactList}\small\item\em 获取套接字 \end{DoxyCompactList}\item 
\hyperlink{classsock_1_1net_1_1_tcp_connection_input_stream}{Tcp\+Connection\+Input\+Stream} \& \hyperlink{classsock_1_1net_1_1_tcp_connection_a60311ccc61cbe63853b5c07027c807e3}{get\+Input\+Stream} (void)
\begin{DoxyCompactList}\small\item\em 获取输入流 \end{DoxyCompactList}\item 
\hyperlink{classsock_1_1net_1_1_tcp_connection_output_stream}{Tcp\+Connection\+Output\+Stream} \& \hyperlink{classsock_1_1net_1_1_tcp_connection_ac8b5476c831b445845d6769e0adf0390}{get\+Output\+Stream} (void)
\begin{DoxyCompactList}\small\item\em 获取输出流 \end{DoxyCompactList}\item 
void \hyperlink{classsock_1_1net_1_1_tcp_connection_a47110635b794afc5a26640984bf3bc97}{set\+Read\+F\+N} (\hyperlink{classsock_1_1net_1_1_tcp_connection_a836ed49de731537f208e17d07868a9d8}{Tcp\+Connection\+Read\+Func} fn)
\begin{DoxyCompactList}\small\item\em 设置读回调 \end{DoxyCompactList}\item 
void \hyperlink{classsock_1_1net_1_1_tcp_connection_a42f560457d86273fe85150a879fe4b50}{set\+Write\+F\+N} (\hyperlink{classsock_1_1net_1_1_tcp_connection_ab8951d995ac681b06a8d8dfdadd219aa}{Tcp\+Connection\+Write\+Func} fn)
\begin{DoxyCompactList}\small\item\em 设置写回调 \end{DoxyCompactList}\item 
void \hyperlink{classsock_1_1net_1_1_tcp_connection_a1007848144d161705c5316ab51e17b36}{set\+Error\+F\+N} (\hyperlink{classsock_1_1net_1_1_tcp_connection_a9d9ea93c3a51141616167ae78c0238ec}{Pass\+Tcp\+Connection\+Ref\+Func} fn)
\begin{DoxyCompactList}\small\item\em 设置错误回调 \end{DoxyCompactList}\item 
void \hyperlink{classsock_1_1net_1_1_tcp_connection_a7588b091cb1d02fd91c2fd0a81197393}{set\+Close\+F\+N} (\hyperlink{classsock_1_1net_1_1_tcp_connection_a9d9ea93c3a51141616167ae78c0238ec}{Pass\+Tcp\+Connection\+Ref\+Func} fn)
\begin{DoxyCompactList}\small\item\em 设置关闭回调 \end{DoxyCompactList}\item 
void \hyperlink{classsock_1_1net_1_1_tcp_connection_a634053043ee4491da121ba3ba78a7a2f}{set\+Heartbeat\+F\+N} (\hyperlink{classsock_1_1net_1_1_tcp_connection_a9d9ea93c3a51141616167ae78c0238ec}{Pass\+Tcp\+Connection\+Ref\+Func} fn)
\begin{DoxyCompactList}\small\item\em 设置心跳回调 \end{DoxyCompactList}\item 
virtual void \hyperlink{classsock_1_1net_1_1_tcp_connection_a7169d0396d8b3f9d3bc0bfa651c39f40}{handle\+Input} (void)
\begin{DoxyCompactList}\small\item\em 处理网络输入 \end{DoxyCompactList}\item 
virtual void \hyperlink{classsock_1_1net_1_1_tcp_connection_ada4e4dc8bcdb148eef20a2b479697bbf}{handle\+Output} (void)
\begin{DoxyCompactList}\small\item\em 处理网络输出 \end{DoxyCompactList}\item 
virtual void \hyperlink{classsock_1_1net_1_1_tcp_connection_ab177cdd1021f1452a8b49c0238ab5186}{handle\+Error} (void)
\begin{DoxyCompactList}\small\item\em 处理网络错误 \end{DoxyCompactList}\item 
virtual void \hyperlink{classsock_1_1net_1_1_tcp_connection_ad5d67c0a60a1f2c9816e550e4f110e21}{handle\+Close} (void)
\begin{DoxyCompactList}\small\item\em 处理关闭 \end{DoxyCompactList}\item 
virtual void \hyperlink{classsock_1_1net_1_1_tcp_connection_a4da2739b37a3ded075a8f44a8e6ef519}{handle\+Heartbeat} (void)
\begin{DoxyCompactList}\small\item\em 处理心跳 \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Friends}
\begin{DoxyCompactItemize}
\item 
class \hyperlink{classsock_1_1net_1_1_tcp_connection_a3ecf3132e8c4bf890c07853cfab7619c}{Tcp\+Server}
\item 
class \hyperlink{classsock_1_1net_1_1_tcp_connection_a0736aba6eec2f2c2a13494228473b67c}{Tcp\+Worker}
\end{DoxyCompactItemize}


\subsection{Detailed Description}
网络连接 

\subsection{Member Typedef Documentation}
\hypertarget{classsock_1_1net_1_1_tcp_connection_a9d9ea93c3a51141616167ae78c0238ec}{}\index{sock\+::net\+::\+Tcp\+Connection@{sock\+::net\+::\+Tcp\+Connection}!Pass\+Tcp\+Connection\+Ref\+Func@{Pass\+Tcp\+Connection\+Ref\+Func}}
\index{Pass\+Tcp\+Connection\+Ref\+Func@{Pass\+Tcp\+Connection\+Ref\+Func}!sock\+::net\+::\+Tcp\+Connection@{sock\+::net\+::\+Tcp\+Connection}}
\subsubsection[{Pass\+Tcp\+Connection\+Ref\+Func}]{\setlength{\rightskip}{0pt plus 5cm}typedef boost\+::function$<$void({\bf Tcp\+Connection}\&)$>$ {\bf sock\+::net\+::\+Tcp\+Connection\+::\+Pass\+Tcp\+Connection\+Ref\+Func}}\label{classsock_1_1net_1_1_tcp_connection_a9d9ea93c3a51141616167ae78c0238ec}
\hypertarget{classsock_1_1net_1_1_tcp_connection_a836ed49de731537f208e17d07868a9d8}{}\index{sock\+::net\+::\+Tcp\+Connection@{sock\+::net\+::\+Tcp\+Connection}!Tcp\+Connection\+Read\+Func@{Tcp\+Connection\+Read\+Func}}
\index{Tcp\+Connection\+Read\+Func@{Tcp\+Connection\+Read\+Func}!sock\+::net\+::\+Tcp\+Connection@{sock\+::net\+::\+Tcp\+Connection}}
\subsubsection[{Tcp\+Connection\+Read\+Func}]{\setlength{\rightskip}{0pt plus 5cm}typedef boost\+::function$<$void({\bf Tcp\+Connection}\&, {\bf Tcp\+Connection\+Input\+Stream}\&)$>$ {\bf sock\+::net\+::\+Tcp\+Connection\+::\+Tcp\+Connection\+Read\+Func}}\label{classsock_1_1net_1_1_tcp_connection_a836ed49de731537f208e17d07868a9d8}
\hypertarget{classsock_1_1net_1_1_tcp_connection_ab8951d995ac681b06a8d8dfdadd219aa}{}\index{sock\+::net\+::\+Tcp\+Connection@{sock\+::net\+::\+Tcp\+Connection}!Tcp\+Connection\+Write\+Func@{Tcp\+Connection\+Write\+Func}}
\index{Tcp\+Connection\+Write\+Func@{Tcp\+Connection\+Write\+Func}!sock\+::net\+::\+Tcp\+Connection@{sock\+::net\+::\+Tcp\+Connection}}
\subsubsection[{Tcp\+Connection\+Write\+Func}]{\setlength{\rightskip}{0pt plus 5cm}typedef boost\+::function$<$void({\bf Tcp\+Connection}\&, {\bf Tcp\+Connection\+Output\+Stream}\&)$>$ {\bf sock\+::net\+::\+Tcp\+Connection\+::\+Tcp\+Connection\+Write\+Func}}\label{classsock_1_1net_1_1_tcp_connection_ab8951d995ac681b06a8d8dfdadd219aa}


\subsection{Member Enumeration Documentation}
\hypertarget{classsock_1_1net_1_1_tcp_connection_ac6a1f1dc74ce847b7aab5f9c1c8d6574}{}\index{sock\+::net\+::\+Tcp\+Connection@{sock\+::net\+::\+Tcp\+Connection}!State@{State}}
\index{State@{State}!sock\+::net\+::\+Tcp\+Connection@{sock\+::net\+::\+Tcp\+Connection}}
\subsubsection[{State}]{\setlength{\rightskip}{0pt plus 5cm}enum {\bf sock\+::net\+::\+Tcp\+Connection\+::\+State}}\label{classsock_1_1net_1_1_tcp_connection_ac6a1f1dc74ce847b7aab5f9c1c8d6574}
\begin{Desc}
\item[Enumerator]\par
\begin{description}
\index{C\+O\+N\+N\+E\+C\+T@{C\+O\+N\+N\+E\+C\+T}!sock\+::net\+::\+Tcp\+Connection@{sock\+::net\+::\+Tcp\+Connection}}\index{sock\+::net\+::\+Tcp\+Connection@{sock\+::net\+::\+Tcp\+Connection}!C\+O\+N\+N\+E\+C\+T@{C\+O\+N\+N\+E\+C\+T}}\item[{\em 
\hypertarget{classsock_1_1net_1_1_tcp_connection_ac6a1f1dc74ce847b7aab5f9c1c8d6574a92fcb3956c72ee14fb17b6d187517d9a}{}C\+O\+N\+N\+E\+C\+T\label{classsock_1_1net_1_1_tcp_connection_ac6a1f1dc74ce847b7aab5f9c1c8d6574a92fcb3956c72ee14fb17b6d187517d9a}
}]\index{C\+L\+O\+S\+I\+N\+G@{C\+L\+O\+S\+I\+N\+G}!sock\+::net\+::\+Tcp\+Connection@{sock\+::net\+::\+Tcp\+Connection}}\index{sock\+::net\+::\+Tcp\+Connection@{sock\+::net\+::\+Tcp\+Connection}!C\+L\+O\+S\+I\+N\+G@{C\+L\+O\+S\+I\+N\+G}}\item[{\em 
\hypertarget{classsock_1_1net_1_1_tcp_connection_ac6a1f1dc74ce847b7aab5f9c1c8d6574a7deeba93cda3dfa27db748cafe5ca9aa}{}C\+L\+O\+S\+I\+N\+G\label{classsock_1_1net_1_1_tcp_connection_ac6a1f1dc74ce847b7aab5f9c1c8d6574a7deeba93cda3dfa27db748cafe5ca9aa}
}]\index{C\+L\+O\+S\+E\+D@{C\+L\+O\+S\+E\+D}!sock\+::net\+::\+Tcp\+Connection@{sock\+::net\+::\+Tcp\+Connection}}\index{sock\+::net\+::\+Tcp\+Connection@{sock\+::net\+::\+Tcp\+Connection}!C\+L\+O\+S\+E\+D@{C\+L\+O\+S\+E\+D}}\item[{\em 
\hypertarget{classsock_1_1net_1_1_tcp_connection_ac6a1f1dc74ce847b7aab5f9c1c8d6574a456b48c073c8b92394f8e74a39646ec4}{}C\+L\+O\+S\+E\+D\label{classsock_1_1net_1_1_tcp_connection_ac6a1f1dc74ce847b7aab5f9c1c8d6574a456b48c073c8b92394f8e74a39646ec4}
}]\end{description}
\end{Desc}


\subsection{Constructor \& Destructor Documentation}
\hypertarget{classsock_1_1net_1_1_tcp_connection_a43ee94855cd5bc5b46e5bb5b3fbb545c}{}\index{sock\+::net\+::\+Tcp\+Connection@{sock\+::net\+::\+Tcp\+Connection}!Tcp\+Connection@{Tcp\+Connection}}
\index{Tcp\+Connection@{Tcp\+Connection}!sock\+::net\+::\+Tcp\+Connection@{sock\+::net\+::\+Tcp\+Connection}}
\subsubsection[{Tcp\+Connection(sock\+\_\+t sock, size\+\_\+t is\+Size=1024 $\ast$32, size\+\_\+t os\+Size=1024 $\ast$32)}]{\setlength{\rightskip}{0pt plus 5cm}Tcp\+Connection\+::\+Tcp\+Connection (
\begin{DoxyParamCaption}
\item[{sock\+\_\+t}]{sock, }
\item[{size\+\_\+t}]{is\+Size = {\ttfamily 1024~$\ast$~32}, }
\item[{size\+\_\+t}]{os\+Size = {\ttfamily 1024~$\ast$~32}}
\end{DoxyParamCaption}
)}\label{classsock_1_1net_1_1_tcp_connection_a43ee94855cd5bc5b46e5bb5b3fbb545c}


Tcp连接构造函数 


\begin{DoxyParams}{Parameters}
{\em sock} & 本地套接字 \\
\hline
{\em is\+Size} & 输入流缓存大小 \\
\hline
{\em os\+Size} & 输出流缓存大小 \\
\hline
\end{DoxyParams}
\hypertarget{classsock_1_1net_1_1_tcp_connection_aa40d248ffbd3fd3aaf82dcf754c1e204}{}\index{sock\+::net\+::\+Tcp\+Connection@{sock\+::net\+::\+Tcp\+Connection}!Tcp\+Connection@{Tcp\+Connection}}
\index{Tcp\+Connection@{Tcp\+Connection}!sock\+::net\+::\+Tcp\+Connection@{sock\+::net\+::\+Tcp\+Connection}}
\subsubsection[{Tcp\+Connection(sock\+\_\+t sock, Byte\+Buffer ibuff, Byte\+Buffer obuff, size\+\_\+t is\+Size, size\+\_\+t os\+Size)}]{\setlength{\rightskip}{0pt plus 5cm}Tcp\+Connection\+::\+Tcp\+Connection (
\begin{DoxyParamCaption}
\item[{sock\+\_\+t}]{sock, }
\item[{{\bf Byte\+Buffer}}]{ibuff, }
\item[{{\bf Byte\+Buffer}}]{obuff, }
\item[{size\+\_\+t}]{is\+Size, }
\item[{size\+\_\+t}]{os\+Size}
\end{DoxyParamCaption}
)}\label{classsock_1_1net_1_1_tcp_connection_aa40d248ffbd3fd3aaf82dcf754c1e204}


Tcp连接构造函数 


\begin{DoxyParams}{Parameters}
{\em sock} & 本地套接字 \\
\hline
{\em ibuff} & 在外部申请的输入流缓存，其大小必须等于is\+Size \\
\hline
{\em os\+Size} & 在外部申请的输出流缓存，其大小必须等于os\+Size \\
\hline
{\em is\+Size} & 输入流缓存大小 \\
\hline
{\em os\+Size} & 输出流缓存大小 \\
\hline
\end{DoxyParams}
\hypertarget{classsock_1_1net_1_1_tcp_connection_a726cd8559fa3a133b47a15f10ebbe6dc}{}\index{sock\+::net\+::\+Tcp\+Connection@{sock\+::net\+::\+Tcp\+Connection}!````~Tcp\+Connection@{$\sim$\+Tcp\+Connection}}
\index{````~Tcp\+Connection@{$\sim$\+Tcp\+Connection}!sock\+::net\+::\+Tcp\+Connection@{sock\+::net\+::\+Tcp\+Connection}}
\subsubsection[{$\sim$\+Tcp\+Connection(void)}]{\setlength{\rightskip}{0pt plus 5cm}Tcp\+Connection\+::$\sim$\+Tcp\+Connection (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [virtual]}}\label{classsock_1_1net_1_1_tcp_connection_a726cd8559fa3a133b47a15f10ebbe6dc}


\subsection{Member Function Documentation}
\hypertarget{classsock_1_1net_1_1_tcp_connection_a180476e4513ce0ccdc23316ce791faf2}{}\index{sock\+::net\+::\+Tcp\+Connection@{sock\+::net\+::\+Tcp\+Connection}!get\+Id@{get\+Id}}
\index{get\+Id@{get\+Id}!sock\+::net\+::\+Tcp\+Connection@{sock\+::net\+::\+Tcp\+Connection}}
\subsubsection[{get\+Id(void) const }]{\setlength{\rightskip}{0pt plus 5cm}int sock\+::net\+::\+Tcp\+Connection\+::get\+Id (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily [inline]}}\label{classsock_1_1net_1_1_tcp_connection_a180476e4513ce0ccdc23316ce791faf2}


获取\+I\+D 

\begin{DoxyReturn}{Returns}
int 
\end{DoxyReturn}
\hypertarget{classsock_1_1net_1_1_tcp_connection_a60311ccc61cbe63853b5c07027c807e3}{}\index{sock\+::net\+::\+Tcp\+Connection@{sock\+::net\+::\+Tcp\+Connection}!get\+Input\+Stream@{get\+Input\+Stream}}
\index{get\+Input\+Stream@{get\+Input\+Stream}!sock\+::net\+::\+Tcp\+Connection@{sock\+::net\+::\+Tcp\+Connection}}
\subsubsection[{get\+Input\+Stream(void)}]{\setlength{\rightskip}{0pt plus 5cm}{\bf Tcp\+Connection\+Input\+Stream}\& sock\+::net\+::\+Tcp\+Connection\+::get\+Input\+Stream (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}\label{classsock_1_1net_1_1_tcp_connection_a60311ccc61cbe63853b5c07027c807e3}


获取输入流 

\begin{DoxyReturn}{Returns}
\hyperlink{classsock_1_1net_1_1_tcp_connection_input_stream}{Tcp\+Connection\+Input\+Stream}\& 
\end{DoxyReturn}
\hypertarget{classsock_1_1net_1_1_tcp_connection_ac8b5476c831b445845d6769e0adf0390}{}\index{sock\+::net\+::\+Tcp\+Connection@{sock\+::net\+::\+Tcp\+Connection}!get\+Output\+Stream@{get\+Output\+Stream}}
\index{get\+Output\+Stream@{get\+Output\+Stream}!sock\+::net\+::\+Tcp\+Connection@{sock\+::net\+::\+Tcp\+Connection}}
\subsubsection[{get\+Output\+Stream(void)}]{\setlength{\rightskip}{0pt plus 5cm}{\bf Tcp\+Connection\+Output\+Stream}\& sock\+::net\+::\+Tcp\+Connection\+::get\+Output\+Stream (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}\label{classsock_1_1net_1_1_tcp_connection_ac8b5476c831b445845d6769e0adf0390}


获取输出流 

\begin{DoxyReturn}{Returns}
\hyperlink{classsock_1_1net_1_1_tcp_connection_output_stream}{Tcp\+Connection\+Output\+Stream}\& 
\end{DoxyReturn}
\hypertarget{classsock_1_1net_1_1_tcp_connection_a895047bafd0cbed7850da3fd355c679c}{}\index{sock\+::net\+::\+Tcp\+Connection@{sock\+::net\+::\+Tcp\+Connection}!get\+Sock@{get\+Sock}}
\index{get\+Sock@{get\+Sock}!sock\+::net\+::\+Tcp\+Connection@{sock\+::net\+::\+Tcp\+Connection}}
\subsubsection[{get\+Sock(void)}]{\setlength{\rightskip}{0pt plus 5cm}{\bf Socket}$\ast$ sock\+::net\+::\+Tcp\+Connection\+::get\+Sock (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}\label{classsock_1_1net_1_1_tcp_connection_a895047bafd0cbed7850da3fd355c679c}


获取套接字 

\begin{DoxyReturn}{Returns}
Socket$\ast$ 
\end{DoxyReturn}
\hypertarget{classsock_1_1net_1_1_tcp_connection_ad5d67c0a60a1f2c9816e550e4f110e21}{}\index{sock\+::net\+::\+Tcp\+Connection@{sock\+::net\+::\+Tcp\+Connection}!handle\+Close@{handle\+Close}}
\index{handle\+Close@{handle\+Close}!sock\+::net\+::\+Tcp\+Connection@{sock\+::net\+::\+Tcp\+Connection}}
\subsubsection[{handle\+Close(void)}]{\setlength{\rightskip}{0pt plus 5cm}void Tcp\+Connection\+::handle\+Close (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [virtual]}}\label{classsock_1_1net_1_1_tcp_connection_ad5d67c0a60a1f2c9816e550e4f110e21}


处理关闭 



Implements \hyperlink{classsock_1_1net_1_1_net_event_handler_a27cc7b4bb1bdbe49694651630e446b05}{sock\+::net\+::\+Net\+Event\+Handler}.

\hypertarget{classsock_1_1net_1_1_tcp_connection_ab177cdd1021f1452a8b49c0238ab5186}{}\index{sock\+::net\+::\+Tcp\+Connection@{sock\+::net\+::\+Tcp\+Connection}!handle\+Error@{handle\+Error}}
\index{handle\+Error@{handle\+Error}!sock\+::net\+::\+Tcp\+Connection@{sock\+::net\+::\+Tcp\+Connection}}
\subsubsection[{handle\+Error(void)}]{\setlength{\rightskip}{0pt plus 5cm}void Tcp\+Connection\+::handle\+Error (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [virtual]}}\label{classsock_1_1net_1_1_tcp_connection_ab177cdd1021f1452a8b49c0238ab5186}


处理网络错误 



Implements \hyperlink{classsock_1_1net_1_1_net_event_handler_aaae522780e3cbf9db5756be8589f9139}{sock\+::net\+::\+Net\+Event\+Handler}.

\hypertarget{classsock_1_1net_1_1_tcp_connection_a4da2739b37a3ded075a8f44a8e6ef519}{}\index{sock\+::net\+::\+Tcp\+Connection@{sock\+::net\+::\+Tcp\+Connection}!handle\+Heartbeat@{handle\+Heartbeat}}
\index{handle\+Heartbeat@{handle\+Heartbeat}!sock\+::net\+::\+Tcp\+Connection@{sock\+::net\+::\+Tcp\+Connection}}
\subsubsection[{handle\+Heartbeat(void)}]{\setlength{\rightskip}{0pt plus 5cm}void Tcp\+Connection\+::handle\+Heartbeat (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [virtual]}}\label{classsock_1_1net_1_1_tcp_connection_a4da2739b37a3ded075a8f44a8e6ef519}


处理心跳 



Implements \hyperlink{classsock_1_1net_1_1_net_event_handler_aa75f2bf4bf3bcd9a83d540aca5497619}{sock\+::net\+::\+Net\+Event\+Handler}.

\hypertarget{classsock_1_1net_1_1_tcp_connection_a7169d0396d8b3f9d3bc0bfa651c39f40}{}\index{sock\+::net\+::\+Tcp\+Connection@{sock\+::net\+::\+Tcp\+Connection}!handle\+Input@{handle\+Input}}
\index{handle\+Input@{handle\+Input}!sock\+::net\+::\+Tcp\+Connection@{sock\+::net\+::\+Tcp\+Connection}}
\subsubsection[{handle\+Input(void)}]{\setlength{\rightskip}{0pt plus 5cm}void Tcp\+Connection\+::handle\+Input (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [virtual]}}\label{classsock_1_1net_1_1_tcp_connection_a7169d0396d8b3f9d3bc0bfa651c39f40}


处理网络输入 



Implements \hyperlink{classsock_1_1net_1_1_net_event_handler_a6fe4d2cffe11a7e21012eb29ed2f393d}{sock\+::net\+::\+Net\+Event\+Handler}.

\hypertarget{classsock_1_1net_1_1_tcp_connection_ada4e4dc8bcdb148eef20a2b479697bbf}{}\index{sock\+::net\+::\+Tcp\+Connection@{sock\+::net\+::\+Tcp\+Connection}!handle\+Output@{handle\+Output}}
\index{handle\+Output@{handle\+Output}!sock\+::net\+::\+Tcp\+Connection@{sock\+::net\+::\+Tcp\+Connection}}
\subsubsection[{handle\+Output(void)}]{\setlength{\rightskip}{0pt plus 5cm}void Tcp\+Connection\+::handle\+Output (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [virtual]}}\label{classsock_1_1net_1_1_tcp_connection_ada4e4dc8bcdb148eef20a2b479697bbf}


处理网络输出 



Implements \hyperlink{classsock_1_1net_1_1_net_event_handler_a2a7887f74cac4207c80225e12ce91a43}{sock\+::net\+::\+Net\+Event\+Handler}.

\hypertarget{classsock_1_1net_1_1_tcp_connection_a7588b091cb1d02fd91c2fd0a81197393}{}\index{sock\+::net\+::\+Tcp\+Connection@{sock\+::net\+::\+Tcp\+Connection}!set\+Close\+F\+N@{set\+Close\+F\+N}}
\index{set\+Close\+F\+N@{set\+Close\+F\+N}!sock\+::net\+::\+Tcp\+Connection@{sock\+::net\+::\+Tcp\+Connection}}
\subsubsection[{set\+Close\+F\+N(\+Pass\+Tcp\+Connection\+Ref\+Func fn)}]{\setlength{\rightskip}{0pt plus 5cm}void sock\+::net\+::\+Tcp\+Connection\+::set\+Close\+F\+N (
\begin{DoxyParamCaption}
\item[{{\bf Pass\+Tcp\+Connection\+Ref\+Func}}]{fn}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}\label{classsock_1_1net_1_1_tcp_connection_a7588b091cb1d02fd91c2fd0a81197393}


设置关闭回调 


\begin{DoxyParams}{Parameters}
{\em fn} & \\
\hline
\end{DoxyParams}
\hypertarget{classsock_1_1net_1_1_tcp_connection_a1007848144d161705c5316ab51e17b36}{}\index{sock\+::net\+::\+Tcp\+Connection@{sock\+::net\+::\+Tcp\+Connection}!set\+Error\+F\+N@{set\+Error\+F\+N}}
\index{set\+Error\+F\+N@{set\+Error\+F\+N}!sock\+::net\+::\+Tcp\+Connection@{sock\+::net\+::\+Tcp\+Connection}}
\subsubsection[{set\+Error\+F\+N(\+Pass\+Tcp\+Connection\+Ref\+Func fn)}]{\setlength{\rightskip}{0pt plus 5cm}void sock\+::net\+::\+Tcp\+Connection\+::set\+Error\+F\+N (
\begin{DoxyParamCaption}
\item[{{\bf Pass\+Tcp\+Connection\+Ref\+Func}}]{fn}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}\label{classsock_1_1net_1_1_tcp_connection_a1007848144d161705c5316ab51e17b36}


设置错误回调 


\begin{DoxyParams}{Parameters}
{\em fn} & \\
\hline
\end{DoxyParams}
\hypertarget{classsock_1_1net_1_1_tcp_connection_a634053043ee4491da121ba3ba78a7a2f}{}\index{sock\+::net\+::\+Tcp\+Connection@{sock\+::net\+::\+Tcp\+Connection}!set\+Heartbeat\+F\+N@{set\+Heartbeat\+F\+N}}
\index{set\+Heartbeat\+F\+N@{set\+Heartbeat\+F\+N}!sock\+::net\+::\+Tcp\+Connection@{sock\+::net\+::\+Tcp\+Connection}}
\subsubsection[{set\+Heartbeat\+F\+N(\+Pass\+Tcp\+Connection\+Ref\+Func fn)}]{\setlength{\rightskip}{0pt plus 5cm}void sock\+::net\+::\+Tcp\+Connection\+::set\+Heartbeat\+F\+N (
\begin{DoxyParamCaption}
\item[{{\bf Pass\+Tcp\+Connection\+Ref\+Func}}]{fn}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}\label{classsock_1_1net_1_1_tcp_connection_a634053043ee4491da121ba3ba78a7a2f}


设置心跳回调 


\begin{DoxyParams}{Parameters}
{\em fn} & \\
\hline
\end{DoxyParams}
\hypertarget{classsock_1_1net_1_1_tcp_connection_a47110635b794afc5a26640984bf3bc97}{}\index{sock\+::net\+::\+Tcp\+Connection@{sock\+::net\+::\+Tcp\+Connection}!set\+Read\+F\+N@{set\+Read\+F\+N}}
\index{set\+Read\+F\+N@{set\+Read\+F\+N}!sock\+::net\+::\+Tcp\+Connection@{sock\+::net\+::\+Tcp\+Connection}}
\subsubsection[{set\+Read\+F\+N(\+Tcp\+Connection\+Read\+Func fn)}]{\setlength{\rightskip}{0pt plus 5cm}void sock\+::net\+::\+Tcp\+Connection\+::set\+Read\+F\+N (
\begin{DoxyParamCaption}
\item[{{\bf Tcp\+Connection\+Read\+Func}}]{fn}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}\label{classsock_1_1net_1_1_tcp_connection_a47110635b794afc5a26640984bf3bc97}


设置读回调 


\begin{DoxyParams}{Parameters}
{\em fn} & \\
\hline
\end{DoxyParams}
\hypertarget{classsock_1_1net_1_1_tcp_connection_a42f560457d86273fe85150a879fe4b50}{}\index{sock\+::net\+::\+Tcp\+Connection@{sock\+::net\+::\+Tcp\+Connection}!set\+Write\+F\+N@{set\+Write\+F\+N}}
\index{set\+Write\+F\+N@{set\+Write\+F\+N}!sock\+::net\+::\+Tcp\+Connection@{sock\+::net\+::\+Tcp\+Connection}}
\subsubsection[{set\+Write\+F\+N(\+Tcp\+Connection\+Write\+Func fn)}]{\setlength{\rightskip}{0pt plus 5cm}void sock\+::net\+::\+Tcp\+Connection\+::set\+Write\+F\+N (
\begin{DoxyParamCaption}
\item[{{\bf Tcp\+Connection\+Write\+Func}}]{fn}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}\label{classsock_1_1net_1_1_tcp_connection_a42f560457d86273fe85150a879fe4b50}


设置写回调 


\begin{DoxyParams}{Parameters}
{\em fn} & \\
\hline
\end{DoxyParams}
\hypertarget{classsock_1_1net_1_1_tcp_connection_a61f65d30aed34c170e355ce5841dc1d3}{}\index{sock\+::net\+::\+Tcp\+Connection@{sock\+::net\+::\+Tcp\+Connection}!shutdown@{shutdown}}
\index{shutdown@{shutdown}!sock\+::net\+::\+Tcp\+Connection@{sock\+::net\+::\+Tcp\+Connection}}
\subsubsection[{shutdown(void)}]{\setlength{\rightskip}{0pt plus 5cm}void Tcp\+Connection\+::shutdown (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}\label{classsock_1_1net_1_1_tcp_connection_a61f65d30aed34c170e355ce5841dc1d3}


关闭连接 



\subsection{Friends And Related Function Documentation}
\hypertarget{classsock_1_1net_1_1_tcp_connection_a3ecf3132e8c4bf890c07853cfab7619c}{}\index{sock\+::net\+::\+Tcp\+Connection@{sock\+::net\+::\+Tcp\+Connection}!Tcp\+Server@{Tcp\+Server}}
\index{Tcp\+Server@{Tcp\+Server}!sock\+::net\+::\+Tcp\+Connection@{sock\+::net\+::\+Tcp\+Connection}}
\subsubsection[{Tcp\+Server}]{\setlength{\rightskip}{0pt plus 5cm}friend class {\bf Tcp\+Server}\hspace{0.3cm}{\ttfamily [friend]}}\label{classsock_1_1net_1_1_tcp_connection_a3ecf3132e8c4bf890c07853cfab7619c}
\hypertarget{classsock_1_1net_1_1_tcp_connection_a0736aba6eec2f2c2a13494228473b67c}{}\index{sock\+::net\+::\+Tcp\+Connection@{sock\+::net\+::\+Tcp\+Connection}!Tcp\+Worker@{Tcp\+Worker}}
\index{Tcp\+Worker@{Tcp\+Worker}!sock\+::net\+::\+Tcp\+Connection@{sock\+::net\+::\+Tcp\+Connection}}
\subsubsection[{Tcp\+Worker}]{\setlength{\rightskip}{0pt plus 5cm}friend class {\bf Tcp\+Worker}\hspace{0.3cm}{\ttfamily [friend]}}\label{classsock_1_1net_1_1_tcp_connection_a0736aba6eec2f2c2a13494228473b67c}


The documentation for this class was generated from the following files\+:\begin{DoxyCompactItemize}
\item 
E\+:/git/sock/sock/net/\hyperlink{tcp__connection_8h}{tcp\+\_\+connection.\+h}\item 
E\+:/git/sock/src/net/\hyperlink{tcp__connection_8cc}{tcp\+\_\+connection.\+cc}\end{DoxyCompactItemize}
